﻿using System;
using Odin.Contracts.Services;
using Odin.Execution;
using Odin.Runners.CommandLine.Resources;

namespace Odin.Runners.CommandLine.Arguments
{
	public class KeepWebServerRunning : ArgumentHandler
	{
		public override string Name { get { return "KeepWebServerRunning"; } }
		public override string Description { get { return ArgumentDescriptions.KeepWebServerRunning; } }
		public override Type[] Dependencies { get { return new[] { typeof(Port) }; } }

		public override void Execute(string value)
		{
			var configuration = Core.Kernel.Get<IConfiguration>();
			configuration.WebServer.KeepServerAlive = true;
		}
	}
}
